package NIO.netty;

import java.net.ServerSocket;
import java.net.Socket;

public class MyServerSocket {

    public static void main(String[] args)throws Exception {
        ServerSocket serverSocket = new ServerSocket(8379);
        Socket socket = serverSocket.accept();

        byte[] buffer = new byte[1024];
        int len = socket.getInputStream().read(buffer);
        System.out.println(new String(buffer ,0 , len , "utf-8"));

        socket.getOutputStream().write(buffer);
        socket.close();
        serverSocket.close();
    }
}
